home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1393 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: chronicle.mti.sgi.com!news
  2. From: austern@isolde.mti.sgi.com (Matt Austern)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Theoretical C++ Question
  5. Date: 10 Jan 1996 20:01:20 GMT
  6. Organization: SGI
  7. Message-ID: <AUSTERN.96Jan10120120@isolde.mti.sgi.com>
  8. References: <4d152b$dd2$1@mhafc.production.compuserve.com>
  9. Reply-To: austern@mti.sgi.com
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. In-reply-to: Pascal Pereira's message of 10 Jan 1996 19:46:19 GMT
  12.  
  13. In article <4d152b$dd2$1@mhafc.production.compuserve.com> Pascal Pereira <71172.2025@CompuServe.COM> writes:
  14.  
  15. > I have an old program written in C that uses function pointers. 
  16. > Is there any way to mimic function pointer code in C++ or does 
  17. > this require a fundamental change to the structure of the 
  18. > old code.
  19.  
  20. C++ has function pointers.  It's quite possible that your code isn't a
  21. valid C++ program (it might, for example, use variable names that are
  22. reserved words in C++ but not in C), so it might be necessary to do
  23. some work to get it to compile as C++, but it should not be necessary
  24. to eliminate function pointers.
  25.  
  26. C++ provides some alternatives that may be better (functor objects,
  27. virtual functions, and so on), but you don't have to change your
  28. design if you don't want to.
  29.  
  30.  
  31. Matt Austern
  32. SGI: MTI Compilers Group
  33. austern@isolde.mti.sgi.com
  34. -- 
  35. Matt Austern
  36. SGI: MTI Compilers Group
  37. austern@isolde.mti.sgi.com
  38.